﻿@model Hospital
<div class="catalog-title">
    科室设置</div>
@*@Ajax.ActionLink("添加科室", "DepartmentItem", new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "dialogbox", OnComplete = "showDialog('科室',true);", HttpMethod = "Get", InsertionMode = InsertionMode.Replace })*@
@Html.Partial("NewLink", new NewLink("enums", "EditDepartment") { RouterValues = new RouteValueDictionary(new { HospitalID = Model.HospitalID }) })
<ul class="stacklist size80x24">
    @foreach (var item in Model.Departments)
    {
        <li>
            <div>
                <div class="titlebox">
                    @Html.DisplayFor(modelItem => item.DepName)
                </div>
                <div class="ctlbox">
                    @Ajax.ActionLink(" ", "EditDepartment", new { ID = item.DepartmentID }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "dialogbox", OnComplete = "showDialog('科室',true);", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" }, new { @class = "ui-icon ui-icon-pencil", style = "display:inline-block;" })
                    @Ajax.ActionLink(" ", "DelDepartment", new { ID = item.DepartmentID }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "departments", HttpMethod = "Get", InsertionMode = InsertionMode.Replace,  Confirm = OnConfirmDel(), OnFailure = "OnSiteError" }, new { @class = "ui-icon ui-icon-close", style = "display:inline-block;" })
                </div>
            </div>
        </li>
    }
</ul>
<script type="text/javascript">
    $(function () {
        $("#departments li").mouseenter(function () { $(".ctlbox", this).fadeIn(); });
        $("#departments li").mouseleave(function () { $(".ctlbox", this).fadeOut(); });
    });
</script>
